#include <iostream>
#include <map>
#include<string>

using namespace std;
int main() {
	map<int, string> Trans{ {0, "(Zero)"}, {1, "(One)"}, {2, "(Two)"}, {3, "(Three)"},
						   {4, "(Four)"}, {5, "(Five)"}, {6, "(Six)"}, {7, "(Seven)"},
						   {8, "(Eight)"}, {9, "(Nine)"} };
	string str;
	getline(cin, str);
	int a[10];
	for (int i = 0; i < 10; i++)
		a[i] = 0;
	for (int i = 0; i < (int)str.length(); i++) {
		if (str[i] >= '0' && str[i] <= '9') {
			cout << Trans[str[i] - '0'];
			a[str[i] - '0']++;
		}
		else
			cout << str[i];
	}
	cout << '\n';
	for (int i = 0; i < 10; i++)
		cout << a[i] << ' ';
	return 0;
}
